import request from '@/utils/request'

// 商品加入购物车
export const insertCartService = ({ skuId, count }) =>
  request.post('/member/cart', {
    skuId,
    count
  })
// 获取购物车商品
export const getCartListService = () => request.get('/member/cart')

// 删除购物车商品
export const deleteCartService = (ids) =>
  request({
    url: '/member/cart',
    method: 'DELETE',
    data: {
      ids
    }
  })

// 合并购物车
export const mergeCartService = (cartInfo) => {
  request.post('/member/cart/merge', cartInfo)
}
// 修改购物车商品数量
export const updateCartNumService = (skuId, data) =>
  request.put(`/member/cart/${skuId}`, data)
